package com.jiumi.baseconfig.service.impl;

import java.util.List;
import com.jiumi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jiumi.baseconfig.mapper.BaseArticleInfoMapper;
import com.jiumi.baseconfig.domain.BaseArticleInfo;
import com.jiumi.baseconfig.service.IBaseArticleInfoService;

/**
 * 文章信息Service业务层处理
 *
 * @author jiumi
 * @date 2023-05-21
 */
@Service
public class BaseArticleInfoServiceImpl implements IBaseArticleInfoService
{
    @Autowired
    private BaseArticleInfoMapper baseArticleInfoMapper;

    /**
     * 查询文章信息
     *
     * @param id 文章信息主键
     * @return 文章信息
     */
    @Override
    public BaseArticleInfo selectBaseArticleInfoById(Long id)
    {
        return baseArticleInfoMapper.selectBaseArticleInfoById(id);
    }

    /**
     * 查询文章信息列表
     *
     * @param baseArticleInfo 文章信息
     * @return 文章信息
     */
    @Override
    public List<BaseArticleInfo> selectBaseArticleInfoList(BaseArticleInfo baseArticleInfo)
    {
        return baseArticleInfoMapper.selectBaseArticleInfoList(baseArticleInfo);
    }

    /**
     * 新增文章信息
     *
     * @param baseArticleInfo 文章信息
     * @return 结果
     */
    @Override
    public int insertBaseArticleInfo(BaseArticleInfo baseArticleInfo)
    {
        baseArticleInfo.setCreateTime(DateUtils.getNowDate());
        return baseArticleInfoMapper.insertBaseArticleInfo(baseArticleInfo);
    }

    /**
     * 修改文章信息
     *
     * @param baseArticleInfo 文章信息
     * @return 结果
     */
    @Override
    public int updateBaseArticleInfo(BaseArticleInfo baseArticleInfo)
    {
        baseArticleInfo.setUpdateTime(DateUtils.getNowDate());
        return baseArticleInfoMapper.updateBaseArticleInfo(baseArticleInfo);
    }

    /**
     * 批量删除文章信息
     *
     * @param ids 需要删除的文章信息主键
     * @return 结果
     */
    @Override
    public int deleteBaseArticleInfoByIds(Long[] ids)
    {
        return baseArticleInfoMapper.deleteBaseArticleInfoByIds(ids);
    }

    /**
     * 删除文章信息信息
     *
     * @param id 文章信息主键
     * @return 结果
     */
    @Override
    public int deleteBaseArticleInfoById(Long id)
    {
        return baseArticleInfoMapper.deleteBaseArticleInfoById(id);
    }
}
